package com.mobileapptracker;

import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.database.Cursor;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
import android.telephony.TelephonyManager;
import android.util.Log;
import android.webkit.WebSettings;
import android.webkit.WebView;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.Semaphore;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.conn.scheme.PlainSocketFactory;
import org.apache.http.conn.scheme.Scheme;
import org.apache.http.conn.scheme.SchemeRegistry;
import org.apache.http.conn.ssl.SSLSocketFactory;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.conn.tsccm.ThreadSafeClientConnManager;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

public class MobileAppTracker
{
  private static final String ATTRIBUTION_ID_COLUMN_NAME = "aid";
  private static final Uri ATTRIBUTION_ID_CONTENT_URI = Uri.parse("content://com.facebook.katana.provider.AttributionIdProvider");
  private static boolean DEBUG = false;
  private static final String IV = "heF9BATUfWuISyO8";
  private SharedPreferences EventQueue;
  private SharedPreferences SP;
  private Encryption URLEnc;
  private HttpClient client;
  private boolean constructed = false;
  private Context context;
  private List<String> encryptList;
  private boolean httpsEncryption = true;
  private boolean initialized = false;
  private String install;
  private String key;
  private ConcurrentHashMap<String, String> paramTable;
  private ScheduledExecutorService pool;
  private Semaphore queueAvailable;

  public MobileAppTracker(Context paramContext, String paramString1, String paramString2)
  {
    this(paramContext, paramString1, paramString2, true, true);
  }

  public MobileAppTracker(Context paramContext, String paramString1, String paramString2, boolean paramBoolean1, boolean paramBoolean2)
  {
    if (this.constructed)
      return;
    this.constructed = true;
    this.context = paramContext;
    this.pool = Executors.newSingleThreadScheduledExecutor();
    this.queueAvailable = new Semaphore(1, true);
    SchemeRegistry localSchemeRegistry = new SchemeRegistry();
    localSchemeRegistry.register(new Scheme("http", PlainSocketFactory.getSocketFactory(), 80));
    localSchemeRegistry.register(new Scheme("https", SSLSocketFactory.getSocketFactory(), 443));
    BasicHttpParams localBasicHttpParams = new BasicHttpParams();
    HttpConnectionParams.setSocketBufferSize(localBasicHttpParams, 8192);
    HttpConnectionParams.setConnectionTimeout(localBasicHttpParams, 5000);
    HttpConnectionParams.setSoTimeout(localBasicHttpParams, 5000);
    this.client = new DefaultHttpClient(new ThreadSafeClientConnManager(localBasicHttpParams, localSchemeRegistry), localBasicHttpParams);
    this.paramTable = new ConcurrentHashMap();
    this.encryptList = Arrays.asList(new String[] { "ir", "d", "db", "dm", "ma", "ov", "cc", "l", "an", "pn", "av", "dc", "ad", "r", "c", "id", "ua", "tpid", "ar", "connection_type", "mobile_country_code", "mobile_network_code", "screen_density", "screen_layout_size", "ti", "android_purchase_status" });
    this.initialized = initializeVariables(paramContext, paramString1, paramString2, paramBoolean1, paramBoolean2);
    this.URLEnc = new Encryption(paramString2, "heF9BATUfWuISyO8");
    this.EventQueue = paramContext.getSharedPreferences("mat_queue", 0);
    this.SP = paramContext.getSharedPreferences("mat_install", 0);
    this.install = this.SP.getString("install", "");
    if ((this.initialized) && (getQueueSize() > 0) && (isOnline()))
      dumpQueue();
    BroadcastReceiver local1 = new BroadcastReceiver()
    {
      public void onReceive(Context paramAnonymousContext, Intent paramAnonymousIntent)
      {
        if ((((ConnectivityManager)paramAnonymousContext.getSystemService("connectivity")).getActiveNetworkInfo() != null) && (MobileAppTracker.this.getQueueSize() > 0))
          MobileAppTracker.this.dumpQueue();
      }
    };
    try
    {
      paramContext.getApplicationContext().unregisterReceiver(local1);
      label449: IntentFilter localIntentFilter = new IntentFilter("android.net.conn.CONNECTIVITY_CHANGE");
      paramContext.getApplicationContext().registerReceiver(local1, localIntentFilter);
      return;
    }
    catch (IllegalArgumentException localIllegalArgumentException)
    {
      break label449;
    }
  }

  private void addEventToQueue(String paramString1, String paramString2)
  {
    try
    {
      this.queueAvailable.acquire();
      localJSONObject = new JSONObject();
    }
    catch (InterruptedException localInterruptedException)
    {
      try
      {
        JSONObject localJSONObject;
        localJSONObject.put("link", paramString1);
        if (paramString2 != null)
          localJSONObject.put("json", paramString2);
        SharedPreferences.Editor localEditor = this.EventQueue.edit();
        int i = 1 + this.EventQueue.getInt("queuesize", 0);
        localEditor.putString(Integer.valueOf(i).toString(), localJSONObject.toString());
        localEditor.putInt("queuesize", i);
        localEditor.commit();
        this.queueAvailable.release();
        return;
        localInterruptedException = localInterruptedException;
        localInterruptedException.printStackTrace();
      }
      catch (JSONException localJSONException)
      {
        while (true)
          localJSONException.printStackTrace();
      }
    }
  }

  private String buildData(String paramString)
  {
    StringBuilder localStringBuilder1 = new StringBuilder(paramString);
    if ((getReferrer() != null) && (getReferrer().length() == 0))
      this.SP = this.context.getSharedPreferences("mat_referrer", 0);
    try
    {
      String str4 = this.SP.getString("referrer", "");
      if (str4.length() != 0)
        setReferrer(str4);
      localObject1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.US).format(new Date());
    }
    catch (ClassCastException localException1)
    {
      try
      {
        String str3 = URLEncoder.encode((String)localObject1, "UTF-8");
        Object localObject1 = str3;
        localObject2 = new StringBuilder();
        localIterator = this.encryptList.iterator();
        if (!localIterator.hasNext())
          ((StringBuilder)localObject2).append("&sd=").append((String)localObject1);
      }
      catch (UnsupportedEncodingException localException1)
      {
        try
        {
          if (getFacebookAttributionId() != null)
            localStringBuilder1.append("&fb_cookie_id=").append(getFacebookAttributionId());
          this.SP = this.context.getSharedPreferences("mat_fb_intent", 0);
          localObject3 = this.SP.getString("action", "");
          if (((String)localObject3).length() == 0);
        }
        catch (Exception localException1)
        {
          try
          {
            while (true)
            {
              Object localObject2;
              Iterator localIterator;
              String str2 = URLEncoder.encode((String)localObject3, "UTF-8");
              Object localObject3 = str2;
              label225: localStringBuilder1.append("&source=").append((String)localObject3);
              SharedPreferences.Editor localEditor = this.SP.edit();
              localEditor.remove("action");
              localEditor.commit();
              try
              {
                StringBuilder localStringBuilder2 = new StringBuilder(this.URLEnc.bytesToHex(this.URLEnc.encrypt(((StringBuilder)localObject2).toString())));
                localObject2 = localStringBuilder2;
                localStringBuilder1.append("&da=").append(((StringBuilder)localObject2).toString());
                return localStringBuilder1.toString();
                localClassCastException = localClassCastException;
                localClassCastException.printStackTrace();
                continue;
                localUnsupportedEncodingException1 = localUnsupportedEncodingException1;
                if (!DEBUG)
                  continue;
                Log.d("MobileAppTracker", "convert system date failed");
                continue;
                String str1 = (String)localIterator.next();
                if (this.paramTable.get(str1) == null)
                  continue;
                ((StringBuilder)localObject2).append("&").append(str1).append("=").append((String)this.paramTable.get(str1));
                continue;
                localException1 = localException1;
                localException1.printStackTrace();
              }
              catch (Exception localException2)
              {
                while (true)
                  localException2.printStackTrace();
              }
            }
          }
          catch (UnsupportedEncodingException localUnsupportedEncodingException2)
          {
            break label225;
          }
        }
      }
    }
  }

  private String buildLink()
  {
    String str1 = "https://";
    if (!this.httpsEncryption)
      str1 = "http://";
    StringBuilder localStringBuilder = new StringBuilder(str1);
    localStringBuilder.append(getAdvertiserId()).append(".engine.mobileapptracking.com/serve?s=android&ver=").append("2.1").append("&pn=").append(getPackageName());
    Iterator localIterator = this.paramTable.keySet().iterator();
    while (true)
    {
      Cursor localCursor;
      Object localObject;
      if (!localIterator.hasNext())
      {
        if (DEBUG)
          localStringBuilder.append("&debug=1&skip_dup=1");
        Uri localUri = Uri.parse("content://" + getPackageName() + "/referrer_apps");
        localCursor = this.context.getContentResolver().query(localUri, null, null, null, "publisher_package_name desc");
        if ((localCursor != null) && (localCursor.moveToFirst()))
          localObject = localCursor.getString(localCursor.getColumnIndex("tracking_id"));
      }
      try
      {
        String str3 = URLEncoder.encode((String)localObject, "UTF-8");
        localObject = str3;
        label195: this.paramTable.put("tracking_id", localObject);
        try
        {
          localCursor.close();
          label215: return localStringBuilder.toString();
          String str2 = (String)localIterator.next();
          if (this.encryptList.contains(str2))
            continue;
          localStringBuilder.append("&").append(str2).append("=").append((String)this.paramTable.get(str2));
        }
        catch (NullPointerException localNullPointerException)
        {
          break label215;
        }
      }
      catch (Exception localException)
      {
        break label195;
      }
    }
  }

  private static boolean containsChar(String paramString)
  {
    char[] arrayOfChar = paramString.toCharArray();
    int i = arrayOfChar.length;
    for (int j = 0; ; j++)
    {
      if (j >= i)
        return false;
      if (Character.isLetter(arrayOfChar[j]))
        return true;
    }
  }

  // ERROR //
  private void dumpQueue()
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_0
    //   3: invokespecial 247	com/mobileapptracker/MobileAppTracker:getQueueSize	()I
    //   6: istore_2
    //   7: iload_2
    //   8: ifne +6 -> 14
    //   11: aload_0
    //   12: monitorexit
    //   13: return
    //   14: iconst_1
    //   15: istore_3
    //   16: iload_2
    //   17: bipush 50
    //   19: if_icmple +10 -> 29
    //   22: iconst_1
    //   23: iload_2
    //   24: bipush 50
    //   26: isub
    //   27: iadd
    //   28: istore_3
    //   29: iload_3
    //   30: iload_2
    //   31: if_icmpgt -20 -> 11
    //   34: iload_3
    //   35: invokestatic 334	java/lang/Integer:valueOf	(I)Ljava/lang/Integer;
    //   38: invokevirtual 338	java/lang/Integer:toString	()Ljava/lang/String;
    //   41: astore 4
    //   43: aload_0
    //   44: getfield 228	com/mobileapptracker/MobileAppTracker:EventQueue	Landroid/content/SharedPreferences;
    //   47: aload 4
    //   49: aconst_null
    //   50: invokeinterface 241 3 0
    //   55: astore 5
    //   57: aload 5
    //   59: ifnull +126 -> 185
    //   62: aconst_null
    //   63: astore 6
    //   65: new 309	org/json/JSONObject
    //   68: dup
    //   69: aload 5
    //   71: invokespecial 556	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   74: astore 7
    //   76: aload 7
    //   78: ldc_w 312
    //   81: invokevirtual 559	org/json/JSONObject:get	(Ljava/lang/String;)Ljava/lang/Object;
    //   84: checkcast 147	java/lang/String
    //   87: astore 6
    //   89: aload 7
    //   91: ldc_w 318
    //   94: invokevirtual 562	org/json/JSONObject:has	(Ljava/lang/String;)Z
    //   97: istore 14
    //   99: aconst_null
    //   100: astore 9
    //   102: iload 14
    //   104: ifeq +16 -> 120
    //   107: aload 7
    //   109: ldc_w 318
    //   112: invokevirtual 559	org/json/JSONObject:get	(Ljava/lang/String;)Ljava/lang/Object;
    //   115: checkcast 147	java/lang/String
    //   118: astore 9
    //   120: aload 6
    //   122: ifnull +63 -> 185
    //   125: aload_0
    //   126: iconst_m1
    //   127: aload_0
    //   128: invokespecial 247	com/mobileapptracker/MobileAppTracker:getQueueSize	()I
    //   131: iadd
    //   132: invokespecial 566	com/mobileapptracker/MobileAppTracker:setQueueSize	(I)V
    //   135: aload_0
    //   136: getfield 228	com/mobileapptracker/MobileAppTracker:EventQueue	Landroid/content/SharedPreferences;
    //   139: invokeinterface 322 1 0
    //   144: astore 11
    //   146: aload 11
    //   148: aload 4
    //   150: invokeinterface 441 2 0
    //   155: pop
    //   156: aload 11
    //   158: invokeinterface 352 1 0
    //   163: pop
    //   164: aload_0
    //   165: getfield 79	com/mobileapptracker/MobileAppTracker:pool	Ljava/util/concurrent/ScheduledExecutorService;
    //   168: new 568	com/mobileapptracker/MobileAppTracker$getLink
    //   171: dup
    //   172: aload_0
    //   173: aload 6
    //   175: aload 9
    //   177: invokespecial 570	com/mobileapptracker/MobileAppTracker$getLink:<init>	(Lcom/mobileapptracker/MobileAppTracker;Ljava/lang/String;Ljava/lang/String;)V
    //   180: invokeinterface 576 2 0
    //   185: iinc 3 1
    //   188: goto -159 -> 29
    //   191: astore 8
    //   193: aload 8
    //   195: invokevirtual 359	org/json/JSONException:printStackTrace	()V
    //   198: aconst_null
    //   199: astore 9
    //   201: goto -81 -> 120
    //   204: astore_1
    //   205: aload_0
    //   206: monitorexit
    //   207: aload_1
    //   208: athrow
    //   209: astore 10
    //   211: aload 10
    //   213: invokevirtual 475	java/lang/Exception:printStackTrace	()V
    //   216: goto -31 -> 185
    //
    // Exception table:
    //   from	to	target	type
    //   65	99	191	org/json/JSONException
    //   107	120	191	org/json/JSONException
    //   2	7	204	finally
    //   34	57	204	finally
    //   65	99	204	finally
    //   107	120	204	finally
    //   125	185	204	finally
    //   193	198	204	finally
    //   211	216	204	finally
    //   125	185	209	java/lang/Exception
  }

  private String getDeviceId(Context paramContext)
  {
    return ((TelephonyManager)paramContext.getSystemService("phone")).getDeviceId();
  }

  private String getFacebookAttributionId()
  {
    String[] arrayOfString = { "aid" };
    Cursor localCursor = this.context.getContentResolver().query(ATTRIBUTION_ID_CONTENT_URI, arrayOfString, null, null, null);
    if ((localCursor == null) || (!localCursor.moveToFirst()))
      return null;
    return localCursor.getString(localCursor.getColumnIndex("aid"));
  }

  private int getQueueSize()
  {
    return this.EventQueue.getInt("queuesize", 0);
  }

  // ERROR //
  private boolean initializeVariables(Context paramContext, String paramString1, String paramString2, boolean paramBoolean1, boolean paramBoolean2)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_2
    //   2: invokevirtual 590	com/mobileapptracker/MobileAppTracker:setAdvertiserId	(Ljava/lang/String;)V
    //   5: aload_0
    //   6: aload_3
    //   7: invokevirtual 593	com/mobileapptracker/MobileAppTracker:setKey	(Ljava/lang/String;)V
    //   10: aload_0
    //   11: ldc_w 595
    //   14: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   17: aload_0
    //   18: aload_1
    //   19: ldc_w 600
    //   22: iconst_0
    //   23: invokevirtual 226	android/content/Context:getSharedPreferences	(Ljava/lang/String;I)Landroid/content/SharedPreferences;
    //   26: putfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   29: aload_0
    //   30: getfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   33: ldc_w 600
    //   36: ldc 235
    //   38: invokeinterface 241 3 0
    //   43: astore 7
    //   45: aload 7
    //   47: invokevirtual 374	java/lang/String:length	()I
    //   50: ifne +43 -> 93
    //   53: invokestatic 606	java/util/UUID:randomUUID	()Ljava/util/UUID;
    //   56: invokevirtual 607	java/util/UUID:toString	()Ljava/lang/String;
    //   59: astore 7
    //   61: aload_0
    //   62: getfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   65: invokeinterface 322 1 0
    //   70: astore 35
    //   72: aload 35
    //   74: ldc_w 600
    //   77: aload 7
    //   79: invokeinterface 345 3 0
    //   84: pop
    //   85: aload 35
    //   87: invokeinterface 352 1 0
    //   92: pop
    //   93: aload_0
    //   94: aload 7
    //   96: invokespecial 610	com/mobileapptracker/MobileAppTracker:setMatId	(Ljava/lang/String;)V
    //   99: aload_0
    //   100: aload_1
    //   101: invokevirtual 511	android/content/Context:getContentResolver	()Landroid/content/ContentResolver;
    //   104: ldc_w 612
    //   107: invokestatic 617	android/provider/Settings$Secure:getString	(Landroid/content/ContentResolver;Ljava/lang/String;)Ljava/lang/String;
    //   110: invokespecial 620	com/mobileapptracker/MobileAppTracker:setAndroidId	(Ljava/lang/String;)V
    //   113: aload_0
    //   114: getstatic 625	android/os/Build:MODEL	Ljava/lang/String;
    //   117: invokespecial 628	com/mobileapptracker/MobileAppTracker:setDeviceModel	(Ljava/lang/String;)V
    //   120: aload_0
    //   121: getstatic 631	android/os/Build:MANUFACTURER	Ljava/lang/String;
    //   124: invokespecial 634	com/mobileapptracker/MobileAppTracker:setDeviceBrand	(Ljava/lang/String;)V
    //   127: aload_0
    //   128: getstatic 639	android/os/Build$VERSION:RELEASE	Ljava/lang/String;
    //   131: invokespecial 642	com/mobileapptracker/MobileAppTracker:setOsVersion	(Ljava/lang/String;)V
    //   134: iload 4
    //   136: ifeq +12 -> 148
    //   139: aload_0
    //   140: aload_0
    //   141: aload_1
    //   142: invokespecial 644	com/mobileapptracker/MobileAppTracker:getDeviceId	(Landroid/content/Context;)Ljava/lang/String;
    //   145: invokespecial 647	com/mobileapptracker/MobileAppTracker:setDeviceId	(Ljava/lang/String;)V
    //   148: iload 5
    //   150: ifeq +49 -> 199
    //   153: aload_1
    //   154: ldc_w 649
    //   157: invokevirtual 583	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   160: checkcast 651	android/net/wifi/WifiManager
    //   163: astore 8
    //   165: aload 8
    //   167: ifnull +32 -> 199
    //   170: aload 8
    //   172: invokevirtual 655	android/net/wifi/WifiManager:getConnectionInfo	()Landroid/net/wifi/WifiInfo;
    //   175: astore 9
    //   177: aload 9
    //   179: ifnull +20 -> 199
    //   182: aload 9
    //   184: invokevirtual 660	android/net/wifi/WifiInfo:getMacAddress	()Ljava/lang/String;
    //   187: ifnull +12 -> 199
    //   190: aload_0
    //   191: aload 9
    //   193: invokevirtual 660	android/net/wifi/WifiInfo:getMacAddress	()Ljava/lang/String;
    //   196: invokespecial 663	com/mobileapptracker/MobileAppTracker:setMacAddress	(Ljava/lang/String;)V
    //   199: aload_1
    //   200: ldc_w 665
    //   203: invokevirtual 583	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   206: checkcast 667	android/net/ConnectivityManager
    //   209: iconst_1
    //   210: invokevirtual 671	android/net/ConnectivityManager:getNetworkInfo	(I)Landroid/net/NetworkInfo;
    //   213: invokevirtual 676	android/net/NetworkInfo:isConnected	()Z
    //   216: ifeq +441 -> 657
    //   219: aload_0
    //   220: ldc_w 678
    //   223: invokespecial 681	com/mobileapptracker/MobileAppTracker:setConnectionType	(Ljava/lang/String;)V
    //   226: aload_1
    //   227: ldc_w 580
    //   230: invokevirtual 583	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   233: checkcast 585	android/telephony/TelephonyManager
    //   236: astore 10
    //   238: aload 10
    //   240: ifnull +476 -> 716
    //   243: aload 10
    //   245: invokevirtual 684	android/telephony/TelephonyManager:getNetworkCountryIso	()Ljava/lang/String;
    //   248: ifnull +428 -> 676
    //   251: aload_0
    //   252: aload 10
    //   254: invokevirtual 684	android/telephony/TelephonyManager:getNetworkCountryIso	()Ljava/lang/String;
    //   257: invokespecial 687	com/mobileapptracker/MobileAppTracker:setCountryCode	(Ljava/lang/String;)V
    //   260: aload_0
    //   261: aload 10
    //   263: invokevirtual 690	android/telephony/TelephonyManager:getNetworkOperatorName	()Ljava/lang/String;
    //   266: invokespecial 693	com/mobileapptracker/MobileAppTracker:setCarrier	(Ljava/lang/String;)V
    //   269: aload 10
    //   271: invokevirtual 696	android/telephony/TelephonyManager:getNetworkOperator	()Ljava/lang/String;
    //   274: astore 11
    //   276: aload 11
    //   278: ifnull +32 -> 310
    //   281: aload 11
    //   283: iconst_0
    //   284: iconst_3
    //   285: invokevirtual 700	java/lang/String:substring	(II)Ljava/lang/String;
    //   288: astore 33
    //   290: aload 11
    //   292: iconst_3
    //   293: invokevirtual 702	java/lang/String:substring	(I)Ljava/lang/String;
    //   296: astore 34
    //   298: aload_0
    //   299: aload 33
    //   301: invokespecial 705	com/mobileapptracker/MobileAppTracker:setMCC	(Ljava/lang/String;)V
    //   304: aload_0
    //   305: aload 34
    //   307: invokespecial 708	com/mobileapptracker/MobileAppTracker:setMNC	(Ljava/lang/String;)V
    //   310: aload_0
    //   311: invokestatic 712	java/util/Locale:getDefault	()Ljava/util/Locale;
    //   314: getstatic 391	java/util/Locale:US	Ljava/util/Locale;
    //   317: invokevirtual 716	java/util/Locale:getDisplayLanguage	(Ljava/util/Locale;)Ljava/lang/String;
    //   320: invokespecial 719	com/mobileapptracker/MobileAppTracker:setLanguage	(Ljava/lang/String;)V
    //   323: aload_0
    //   324: ldc_w 721
    //   327: invokevirtual 724	com/mobileapptracker/MobileAppTracker:setCurrencyCode	(Ljava/lang/String;)V
    //   330: aload_1
    //   331: invokevirtual 728	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   334: astore 30
    //   336: aload_0
    //   337: aload 30
    //   339: aload 30
    //   341: ldc_w 730
    //   344: ldc_w 732
    //   347: aload_1
    //   348: invokevirtual 733	android/content/Context:getPackageName	()Ljava/lang/String;
    //   351: invokevirtual 739	android/content/res/Resources:getIdentifier	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I
    //   354: invokevirtual 743	android/content/res/Resources:getText	(I)Ljava/lang/CharSequence;
    //   357: invokeinterface 746 1 0
    //   362: invokespecial 749	com/mobileapptracker/MobileAppTracker:setAppName	(Ljava/lang/String;)V
    //   365: aload_0
    //   366: aload_1
    //   367: invokevirtual 733	android/content/Context:getPackageName	()Ljava/lang/String;
    //   370: invokevirtual 752	com/mobileapptracker/MobileAppTracker:setPackageName	(Ljava/lang/String;)V
    //   373: aload_0
    //   374: aload_1
    //   375: ldc_w 376
    //   378: iconst_0
    //   379: invokevirtual 226	android/content/Context:getSharedPreferences	(Ljava/lang/String;I)Landroid/content/SharedPreferences;
    //   382: putfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   385: aload_0
    //   386: aload_0
    //   387: getfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   390: ldc_w 378
    //   393: ldc 235
    //   395: invokeinterface 241 3 0
    //   400: invokevirtual 381	com/mobileapptracker/MobileAppTracker:setReferrer	(Ljava/lang/String;)V
    //   403: aload_0
    //   404: aload_1
    //   405: ldc 230
    //   407: iconst_0
    //   408: invokevirtual 226	android/content/Context:getSharedPreferences	(Ljava/lang/String;I)Landroid/content/SharedPreferences;
    //   411: putfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   414: aload_0
    //   415: aload_0
    //   416: getfield 232	com/mobileapptracker/MobileAppTracker:SP	Landroid/content/SharedPreferences;
    //   419: ldc 233
    //   421: ldc 235
    //   423: invokeinterface 241 3 0
    //   428: putfield 243	com/mobileapptracker/MobileAppTracker:install	Ljava/lang/String;
    //   431: aload_0
    //   432: aload_1
    //   433: invokevirtual 756	android/content/Context:getPackageManager	()Landroid/content/pm/PackageManager;
    //   436: aload_0
    //   437: getfield 71	com/mobileapptracker/MobileAppTracker:context	Landroid/content/Context;
    //   440: invokevirtual 733	android/content/Context:getPackageName	()Ljava/lang/String;
    //   443: iconst_0
    //   444: invokevirtual 762	android/content/pm/PackageManager:getPackageInfo	(Ljava/lang/String;I)Landroid/content/pm/PackageInfo;
    //   447: getfield 768	android/content/pm/PackageInfo:versionCode	I
    //   450: invokespecial 771	com/mobileapptracker/MobileAppTracker:setAppVersion	(I)V
    //   453: aload_1
    //   454: invokevirtual 756	android/content/Context:getPackageManager	()Landroid/content/pm/PackageManager;
    //   457: aload_0
    //   458: getfield 71	com/mobileapptracker/MobileAppTracker:context	Landroid/content/Context;
    //   461: invokevirtual 733	android/content/Context:getPackageName	()Ljava/lang/String;
    //   464: iconst_0
    //   465: invokevirtual 775	android/content/pm/PackageManager:getApplicationInfo	(Ljava/lang/String;I)Landroid/content/pm/ApplicationInfo;
    //   468: getfield 780	android/content/pm/ApplicationInfo:sourceDir	Ljava/lang/String;
    //   471: astore 26
    //   473: new 782	java/io/File
    //   476: dup
    //   477: aload 26
    //   479: invokespecial 783	java/io/File:<init>	(Ljava/lang/String;)V
    //   482: astore 27
    //   484: new 396	java/util/Date
    //   487: dup
    //   488: aload 27
    //   490: invokevirtual 787	java/io/File:lastModified	()J
    //   493: invokespecial 790	java/util/Date:<init>	(J)V
    //   496: astore 28
    //   498: new 383	java/text/SimpleDateFormat
    //   501: dup
    //   502: ldc_w 385
    //   505: getstatic 391	java/util/Locale:US	Ljava/util/Locale;
    //   508: invokespecial 394	java/text/SimpleDateFormat:<init>	(Ljava/lang/String;Ljava/util/Locale;)V
    //   511: astore 29
    //   513: aload 29
    //   515: ldc_w 792
    //   518: invokestatic 798	java/util/TimeZone:getTimeZone	(Ljava/lang/String;)Ljava/util/TimeZone;
    //   521: invokevirtual 802	java/text/SimpleDateFormat:setTimeZone	(Ljava/util/TimeZone;)V
    //   524: aload_0
    //   525: aload 29
    //   527: aload 28
    //   529: invokevirtual 401	java/text/SimpleDateFormat:format	(Ljava/util/Date;)Ljava/lang/String;
    //   532: invokespecial 805	com/mobileapptracker/MobileAppTracker:setInstallDate	(Ljava/lang/String;)V
    //   535: new 807	android/os/Handler
    //   538: dup
    //   539: invokestatic 813	android/os/Looper:getMainLooper	()Landroid/os/Looper;
    //   542: invokespecial 816	android/os/Handler:<init>	(Landroid/os/Looper;)V
    //   545: astore 20
    //   547: new 818	com/mobileapptracker/MobileAppTracker$getUserAgent
    //   550: dup
    //   551: aload_0
    //   552: aload_1
    //   553: invokespecial 821	com/mobileapptracker/MobileAppTracker$getUserAgent:<init>	(Lcom/mobileapptracker/MobileAppTracker;Landroid/content/Context;)V
    //   556: astore 21
    //   558: aload 20
    //   560: aload 21
    //   562: invokevirtual 825	android/os/Handler:post	(Ljava/lang/Runnable;)Z
    //   565: pop
    //   566: aload_0
    //   567: aload_1
    //   568: invokevirtual 728	android/content/Context:getResources	()Landroid/content/res/Resources;
    //   571: invokevirtual 829	android/content/res/Resources:getDisplayMetrics	()Landroid/util/DisplayMetrics;
    //   574: getfield 835	android/util/DisplayMetrics:density	F
    //   577: invokestatic 840	java/lang/Float:toString	(F)Ljava/lang/String;
    //   580: invokespecial 843	com/mobileapptracker/MobileAppTracker:setScreenDensity	(Ljava/lang/String;)V
    //   583: aload_1
    //   584: ldc_w 845
    //   587: invokevirtual 583	android/content/Context:getSystemService	(Ljava/lang/String;)Ljava/lang/Object;
    //   590: checkcast 847	android/view/WindowManager
    //   593: astore 23
    //   595: aload 23
    //   597: invokeinterface 851 1 0
    //   602: invokevirtual 856	android/view/Display:getWidth	()I
    //   605: istore 24
    //   607: aload 23
    //   609: invokeinterface 851 1 0
    //   614: invokevirtual 859	android/view/Display:getHeight	()I
    //   617: istore 25
    //   619: aload_0
    //   620: new 367	java/lang/StringBuilder
    //   623: dup
    //   624: iload 24
    //   626: invokestatic 861	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   629: invokestatic 864	java/lang/String:valueOf	(Ljava/lang/Object;)Ljava/lang/String;
    //   632: invokespecial 368	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   635: ldc_w 866
    //   638: invokevirtual 426	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   641: iload 25
    //   643: invokestatic 861	java/lang/Integer:toString	(I)Ljava/lang/String;
    //   646: invokevirtual 426	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   649: invokevirtual 442	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   652: invokespecial 869	com/mobileapptracker/MobileAppTracker:setScreenSize	(Ljava/lang/String;)V
    //   655: iconst_1
    //   656: ireturn
    //   657: aload_0
    //   658: ldc_w 871
    //   661: invokespecial 681	com/mobileapptracker/MobileAppTracker:setConnectionType	(Ljava/lang/String;)V
    //   664: goto -438 -> 226
    //   667: astore 6
    //   669: aload 6
    //   671: invokevirtual 475	java/lang/Exception:printStackTrace	()V
    //   674: iconst_0
    //   675: ireturn
    //   676: iload 4
    //   678: ifeq -418 -> 260
    //   681: aload 10
    //   683: invokevirtual 874	android/telephony/TelephonyManager:getSimCountryIso	()Ljava/lang/String;
    //   686: ifnull -426 -> 260
    //   689: aload_0
    //   690: aload 10
    //   692: invokevirtual 874	android/telephony/TelephonyManager:getSimCountryIso	()Ljava/lang/String;
    //   695: invokespecial 687	com/mobileapptracker/MobileAppTracker:setCountryCode	(Ljava/lang/String;)V
    //   698: goto -438 -> 260
    //   701: astore 31
    //   703: ldc_w 455
    //   706: ldc_w 876
    //   709: invokestatic 462	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
    //   712: pop
    //   713: goto -403 -> 310
    //   716: aload_0
    //   717: invokestatic 712	java/util/Locale:getDefault	()Ljava/util/Locale;
    //   720: invokevirtual 879	java/util/Locale:getCountry	()Ljava/lang/String;
    //   723: invokespecial 687	com/mobileapptracker/MobileAppTracker:setCountryCode	(Ljava/lang/String;)V
    //   726: goto -416 -> 310
    //   729: astore 12
    //   731: ldc_w 455
    //   734: ldc_w 881
    //   737: invokestatic 462	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
    //   740: pop
    //   741: goto -376 -> 365
    //   744: astore 14
    //   746: ldc_w 455
    //   749: ldc_w 883
    //   752: invokestatic 462	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
    //   755: pop
    //   756: goto -353 -> 403
    //   759: astore 16
    //   761: aload_0
    //   762: ldc 235
    //   764: putfield 243	com/mobileapptracker/MobileAppTracker:install	Ljava/lang/String;
    //   767: goto -336 -> 431
    //   770: astore 17
    //   772: ldc_w 455
    //   775: ldc_w 885
    //   778: invokestatic 462	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
    //   781: pop
    //   782: aload_0
    //   783: iconst_0
    //   784: invokespecial 771	com/mobileapptracker/MobileAppTracker:setAppVersion	(I)V
    //   787: goto -334 -> 453
    //   790: astore 19
    //   792: aload_0
    //   793: ldc_w 887
    //   796: invokespecial 805	com/mobileapptracker/MobileAppTracker:setInstallDate	(Ljava/lang/String;)V
    //   799: goto -264 -> 535
    //
    // Exception table:
    //   from	to	target	type
    //   0	93	667	java/lang/Exception
    //   93	134	667	java/lang/Exception
    //   139	148	667	java/lang/Exception
    //   153	165	667	java/lang/Exception
    //   170	177	667	java/lang/Exception
    //   182	199	667	java/lang/Exception
    //   199	226	667	java/lang/Exception
    //   226	238	667	java/lang/Exception
    //   243	260	667	java/lang/Exception
    //   260	276	667	java/lang/Exception
    //   310	330	667	java/lang/Exception
    //   365	373	667	java/lang/Exception
    //   535	655	667	java/lang/Exception
    //   657	664	667	java/lang/Exception
    //   681	698	667	java/lang/Exception
    //   703	713	667	java/lang/Exception
    //   716	726	667	java/lang/Exception
    //   731	741	667	java/lang/Exception
    //   746	756	667	java/lang/Exception
    //   761	767	667	java/lang/Exception
    //   772	787	667	java/lang/Exception
    //   792	799	667	java/lang/Exception
    //   281	310	701	java/lang/Exception
    //   330	365	729	java/lang/Exception
    //   373	403	744	java/lang/Exception
    //   403	431	759	java/lang/Exception
    //   431	453	770	java/lang/Exception
    //   453	535	790	java/lang/Exception
  }

  private boolean isOnline()
  {
    try
    {
      NetworkInfo localNetworkInfo = ((ConnectivityManager)this.context.getSystemService("connectivity")).getActiveNetworkInfo();
      if (localNetworkInfo != null)
        return true;
    }
    catch (Exception localException)
    {
    }
    return false;
  }

  private void putInParamTable(String paramString1, String paramString2)
  {
    try
    {
      paramString2 = URLEncoder.encode(paramString2, "UTF-8");
      this.paramTable.put(paramString1, paramString2);
      return;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      while (!DEBUG);
      Log.d("MobileAppTracker", "Failed encoding " + paramString2);
      return;
    }
    catch (NullPointerException localNullPointerException)
    {
      while (!DEBUG);
      Log.d("MobileAppTracker", "Failed to set " + paramString1 + ": received null");
    }
  }

  private void setAndroidId(String paramString)
  {
    putInParamTable("ad", paramString);
  }

  private void setAppName(String paramString)
  {
    putInParamTable("an", paramString);
  }

  private void setAppVersion(int paramInt)
  {
    putInParamTable("av", Integer.toString(paramInt));
  }

  private void setCarrier(String paramString)
  {
    putInParamTable("dc", paramString);
  }

  private void setConnectionType(String paramString)
  {
    putInParamTable("connection_type", paramString);
  }

  private void setCountryCode(String paramString)
  {
    putInParamTable("cc", paramString);
  }

  private void setDeviceBrand(String paramString)
  {
    putInParamTable("db", paramString);
  }

  private void setDeviceId(String paramString)
  {
    putInParamTable("d", paramString);
  }

  private void setDeviceModel(String paramString)
  {
    putInParamTable("dm", paramString);
  }

  private void setInstallDate(String paramString)
  {
    putInParamTable("id", paramString);
  }

  private void setLanguage(String paramString)
  {
    putInParamTable("l", paramString);
  }

  private void setMCC(String paramString)
  {
    putInParamTable("mobile_country_code", paramString);
  }

  private void setMNC(String paramString)
  {
    putInParamTable("mobile_network_code", paramString);
  }

  private void setMacAddress(String paramString)
  {
    putInParamTable("ma", paramString);
  }

  private void setMatId(String paramString)
  {
    putInParamTable("mi", paramString);
  }

  private void setOsVersion(String paramString)
  {
    putInParamTable("ov", paramString);
  }

  private void setPurchaseStatus(int paramInt)
  {
    putInParamTable("android_purchase_status", Integer.toString(paramInt));
  }

  private void setQueueSize(int paramInt)
  {
    SharedPreferences.Editor localEditor = this.EventQueue.edit();
    if (paramInt < 0)
      paramInt = 0;
    localEditor.putInt("queuesize", paramInt);
    localEditor.commit();
  }

  private void setScreenDensity(String paramString)
  {
    putInParamTable("screen_density", paramString);
  }

  private void setScreenSize(String paramString)
  {
    putInParamTable("screen_layout_size", paramString);
  }

  private void setUserAgent(String paramString)
  {
    putInParamTable("ua", paramString);
  }

  // ERROR //
  private int track(String paramString1, String paramString2, double paramDouble, String paramString3)
  {
    // Byte code:
    //   0: aload_0
    //   1: monitorenter
    //   2: aload_0
    //   3: getfield 65	com/mobileapptracker/MobileAppTracker:initialized	Z
    //   6: istore 7
    //   8: iload 7
    //   10: ifne +11 -> 21
    //   13: iconst_m1
    //   14: istore 14
    //   16: aload_0
    //   17: monitorexit
    //   18: iload 14
    //   20: ireturn
    //   21: aload_0
    //   22: getfield 145	com/mobileapptracker/MobileAppTracker:paramTable	Ljava/util/concurrent/ConcurrentHashMap;
    //   25: ldc_w 907
    //   28: invokevirtual 909	java/util/concurrent/ConcurrentHashMap:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   31: pop
    //   32: aload_0
    //   33: getfield 145	com/mobileapptracker/MobileAppTracker:paramTable	Ljava/util/concurrent/ConcurrentHashMap;
    //   36: ldc_w 911
    //   39: invokevirtual 909	java/util/concurrent/ConcurrentHashMap:remove	(Ljava/lang/Object;)Ljava/lang/Object;
    //   42: pop
    //   43: aload_0
    //   44: ldc_w 595
    //   47: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   50: aload_1
    //   51: invokestatic 913	com/mobileapptracker/MobileAppTracker:containsChar	(Ljava/lang/String;)Z
    //   54: ifeq +163 -> 217
    //   57: aload_1
    //   58: ldc_w 915
    //   61: invokevirtual 918	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   64: ifeq +80 -> 144
    //   67: aload_0
    //   68: ldc_w 915
    //   71: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   74: aload_0
    //   75: dload_3
    //   76: invokevirtual 922	com/mobileapptracker/MobileAppTracker:setRevenue	(D)V
    //   79: aload 5
    //   81: ifnull +9 -> 90
    //   84: aload_0
    //   85: aload 5
    //   87: invokevirtual 724	com/mobileapptracker/MobileAppTracker:setCurrencyCode	(Ljava/lang/String;)V
    //   90: aload_0
    //   91: invokespecial 924	com/mobileapptracker/MobileAppTracker:buildLink	()Ljava/lang/String;
    //   94: astore 17
    //   96: aload 17
    //   98: astore 11
    //   100: aload_0
    //   101: invokespecial 251	com/mobileapptracker/MobileAppTracker:isOnline	()Z
    //   104: istore 12
    //   106: iload 12
    //   108: ifeq +140 -> 248
    //   111: aload_0
    //   112: getfield 79	com/mobileapptracker/MobileAppTracker:pool	Ljava/util/concurrent/ScheduledExecutorService;
    //   115: new 568	com/mobileapptracker/MobileAppTracker$getLink
    //   118: dup
    //   119: aload_0
    //   120: aload 11
    //   122: aload_2
    //   123: invokespecial 570	com/mobileapptracker/MobileAppTracker$getLink:<init>	(Lcom/mobileapptracker/MobileAppTracker;Ljava/lang/String;Ljava/lang/String;)V
    //   126: ldc2_w 925
    //   129: getstatic 932	java/util/concurrent/TimeUnit:MILLISECONDS	Ljava/util/concurrent/TimeUnit;
    //   132: invokeinterface 936 5 0
    //   137: pop
    //   138: iconst_1
    //   139: istore 14
    //   141: goto -125 -> 16
    //   144: aload_1
    //   145: ldc_w 937
    //   148: invokevirtual 918	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   151: ifeq +20 -> 171
    //   154: aload_0
    //   155: ldc_w 937
    //   158: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   161: goto -87 -> 74
    //   164: astore 6
    //   166: aload_0
    //   167: monitorexit
    //   168: aload 6
    //   170: athrow
    //   171: aload_1
    //   172: ldc 233
    //   174: invokevirtual 918	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   177: ifeq +12 -> 189
    //   180: aload_0
    //   181: ldc 233
    //   183: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   186: goto -112 -> 74
    //   189: aload_1
    //   190: ldc_w 939
    //   193: invokevirtual 918	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   196: ifeq +13 -> 209
    //   199: aload_0
    //   200: ldc_w 939
    //   203: invokevirtual 598	com/mobileapptracker/MobileAppTracker:setAction	(Ljava/lang/String;)V
    //   206: goto -132 -> 74
    //   209: aload_0
    //   210: aload_1
    //   211: invokevirtual 942	com/mobileapptracker/MobileAppTracker:setEventName	(Ljava/lang/String;)V
    //   214: goto -140 -> 74
    //   217: aload_0
    //   218: aload_1
    //   219: invokevirtual 945	com/mobileapptracker/MobileAppTracker:setEventId	(Ljava/lang/String;)V
    //   222: goto -148 -> 74
    //   225: astore 10
    //   227: aload 10
    //   229: invokevirtual 475	java/lang/Exception:printStackTrace	()V
    //   232: aconst_null
    //   233: astore 11
    //   235: goto -135 -> 100
    //   238: astore 15
    //   240: aload 15
    //   242: invokevirtual 475	java/lang/Exception:printStackTrace	()V
    //   245: goto -107 -> 138
    //   248: aload_0
    //   249: aload 11
    //   251: aload_2
    //   252: invokespecial 297	com/mobileapptracker/MobileAppTracker:addEventToQueue	(Ljava/lang/String;Ljava/lang/String;)V
    //   255: getstatic 54	com/mobileapptracker/MobileAppTracker:DEBUG	Z
    //   258: ifeq -120 -> 138
    //   261: ldc_w 455
    //   264: ldc_w 947
    //   267: invokestatic 462	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
    //   270: pop
    //   271: goto -133 -> 138
    //
    // Exception table:
    //   from	to	target	type
    //   2	8	164	finally
    //   21	74	164	finally
    //   74	79	164	finally
    //   84	90	164	finally
    //   90	96	164	finally
    //   100	106	164	finally
    //   111	138	164	finally
    //   144	161	164	finally
    //   171	186	164	finally
    //   189	206	164	finally
    //   209	214	164	finally
    //   217	222	164	finally
    //   227	232	164	finally
    //   240	245	164	finally
    //   248	271	164	finally
    //   90	96	225	java/lang/Exception
    //   111	138	238	java/lang/Exception
  }

  public String getAction()
  {
    return (String)this.paramTable.get("ac");
  }

  public String getAdvertiserId()
  {
    return (String)this.paramTable.get("adv");
  }

  public String getAndroidId()
  {
    return (String)this.paramTable.get("ad");
  }

  public String getAppName()
  {
    return (String)this.paramTable.get("an");
  }

  public int getAppVersion()
  {
    return Integer.parseInt((String)this.paramTable.get("av"));
  }

  public String getCarrier()
  {
    return (String)this.paramTable.get("dc");
  }

  public String getConnectionType()
  {
    return (String)this.paramTable.get("connection_type");
  }

  public String getCountryCode()
  {
    return (String)this.paramTable.get("cc");
  }

  public String getCurrencyCode()
  {
    return (String)this.paramTable.get("c");
  }

  public String getDeviceBrand()
  {
    return (String)this.paramTable.get("db");
  }

  public String getDeviceId()
  {
    return (String)this.paramTable.get("d");
  }

  public String getDeviceModel()
  {
    return (String)this.paramTable.get("dm");
  }

  public String getEventId()
  {
    return (String)this.paramTable.get("ei");
  }

  public String getEventName()
  {
    return (String)this.paramTable.get("en");
  }

  public String getInstallDate()
  {
    return (String)this.paramTable.get("id");
  }

  public final String getKey()
  {
    return this.key;
  }

  public String getLanguage()
  {
    return (String)this.paramTable.get("l");
  }

  public String getMCC()
  {
    return (String)this.paramTable.get("mobile_country_code");
  }

  public String getMNC()
  {
    return (String)this.paramTable.get("mobile_network_code");
  }

  public String getMacAddress()
  {
    return (String)this.paramTable.get("ma");
  }

  public String getMatId()
  {
    return (String)this.paramTable.get("mi");
  }

  public String getOsId()
  {
    return (String)this.paramTable.get("oi");
  }

  public String getOsVersion()
  {
    return (String)this.paramTable.get("ov");
  }

  public String getPackageName()
  {
    return (String)this.paramTable.get("pn");
  }

  public String getRefId()
  {
    return (String)this.paramTable.get("ar");
  }

  public String getReferrer()
  {
    return (String)this.paramTable.get("ir");
  }

  public String getRevenue()
  {
    return (String)this.paramTable.get("r");
  }

  public String getScreenDensity()
  {
    return (String)this.paramTable.get("screen_density");
  }

  public String getScreenSize()
  {
    return (String)this.paramTable.get("screen_layout_size");
  }

  public String getSiteId()
  {
    return (String)this.paramTable.get("si");
  }

  public String getTRUSTeId()
  {
    return (String)this.paramTable.get("tpid");
  }

  public String getUserId()
  {
    return (String)this.paramTable.get("ui");
  }

  public boolean isInitialized()
  {
    return this.initialized;
  }

  public void setAction(String paramString)
  {
    putInParamTable("ac", paramString);
  }

  public void setAdvertiserId(String paramString)
  {
    putInParamTable("adv", paramString);
  }

  public void setCurrencyCode(String paramString)
  {
    putInParamTable("c", paramString);
  }

  public void setDebugMode(boolean paramBoolean)
  {
    DEBUG = paramBoolean;
  }

  public void setEventId(String paramString)
  {
    putInParamTable("ei", paramString);
  }

  public void setEventName(String paramString)
  {
    putInParamTable("en", paramString);
  }

  public void setHttpsEncryption(boolean paramBoolean)
  {
    this.httpsEncryption = paramBoolean;
  }

  public void setKey(String paramString)
  {
    this.key = paramString;
    this.URLEnc = new Encryption(paramString, "heF9BATUfWuISyO8");
  }

  public void setOsId(String paramString)
  {
    putInParamTable("oi", paramString);
  }

  public void setPackageName(String paramString)
  {
    putInParamTable("pn", paramString);
  }

  public void setRefId(String paramString)
  {
    putInParamTable("ar", paramString);
  }

  public void setReferrer(String paramString)
  {
    putInParamTable("ir", paramString);
  }

  public void setRevenue(double paramDouble)
  {
    putInParamTable("r", Double.toString(paramDouble));
  }

  public void setSiteId(String paramString)
  {
    putInParamTable("si", paramString);
  }

  public void setTRUSTeId(String paramString)
  {
    putInParamTable("tpid", paramString);
  }

  public String setTracking(String paramString1, String paramString2, String paramString3, String paramString4, boolean paramBoolean)
  {
    String str1 = "";
    Object localObject = "";
    StringBuilder localStringBuilder = new StringBuilder("http://engine.mobileapptracking.com/serve?action=click&sdk=android");
    localStringBuilder.append("&publisher_advertiser_id=").append(paramString1);
    localStringBuilder.append("&package_name=").append(paramString2);
    if (paramString3 != null)
      localStringBuilder.append("&publisher_id=").append(paramString3);
    if (paramString4 != null)
      localStringBuilder.append("&campaign_id=").append(paramString4);
    localStringBuilder.append("&response_format=json");
    HttpGet localHttpGet = new HttpGet(localStringBuilder.toString());
    try
    {
      JSONObject localJSONObject = new JSONObject(new BufferedReader(new InputStreamReader(this.client.execute(localHttpGet).getEntity().getContent(), "UTF-8"), 8192).readLine());
      str1 = localJSONObject.getString("tracking_id");
      String str2 = localJSONObject.getString("url");
      localObject = str2;
      ContentValues localContentValues = new ContentValues();
      localContentValues.put("publisher_package_name", getPackageName());
      localContentValues.put("tracking_id", str1);
      Uri localUri = Uri.parse("content://" + paramString2 + "/referrer_apps");
      this.context.getContentResolver().insert(localUri, localContentValues);
      if (!paramBoolean);
    }
    catch (Exception localException1)
    {
      try
      {
        Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse((String)localObject));
        localIntent.addFlags(268435456);
        this.context.startActivity(localIntent);
        return localObject;
        localException1 = localException1;
        localException1.printStackTrace();
      }
      catch (Exception localException2)
      {
      }
    }
    return localObject;
  }

  public void setUserId(String paramString)
  {
    putInParamTable("ui", paramString);
  }

  public int trackAction(String paramString)
  {
    return track(paramString, null, 0.0D, null);
  }

  public int trackAction(String paramString, double paramDouble)
  {
    return track(paramString, null, paramDouble, null);
  }

  public int trackAction(String paramString1, double paramDouble, String paramString2)
  {
    return track(paramString1, null, paramDouble, paramString2);
  }

  public int trackAction(String paramString, List paramList)
  {
    JSONArray localJSONArray = new JSONArray();
    for (int i = 0; ; i++)
    {
      if (i >= paramList.size())
        return track(paramString, localJSONArray.toString(), 0.0D, null);
      localJSONArray.put(new JSONObject((Map)paramList.get(i)));
    }
  }

  public int trackAction(String paramString, Map paramMap)
  {
    JSONObject localJSONObject = new JSONObject(paramMap);
    JSONArray localJSONArray = new JSONArray();
    localJSONArray.put(localJSONObject);
    return track(paramString, localJSONArray.toString(), 0.0D, null);
  }

  public int trackInstall()
  {
    return trackInstall(this.context);
  }

  public int trackInstall(Context paramContext)
  {
    while (true)
    {
      try
      {
        this.SP = paramContext.getSharedPreferences("mat_install", 0);
        this.install = this.SP.getString("install", "");
        if (!this.install.equals(""))
        {
          this.SP = paramContext.getSharedPreferences("mat_app_version", 0);
          String str = this.SP.getString("version", "");
          if ((str.length() != 0) && (Integer.parseInt(str) != getAppVersion()))
          {
            if (DEBUG)
              Log.d("MobileAppTracker", "App version has changed since last trackInstall, sending update to server");
            track("update", null, 0.0D, null);
            SharedPreferences.Editor localEditor3 = this.SP.edit();
            localEditor3.putString("version", Integer.toString(getAppVersion()));
            localEditor3.commit();
            j = 3;
            return j;
          }
          if (DEBUG)
            Log.d("MobileAppTracker", "Install has been tracked before");
        }
        else
        {
          this.SP = paramContext.getSharedPreferences("mat_install", 0);
          SharedPreferences.Editor localEditor1 = this.SP.edit();
          localEditor1.putString("install", "installed");
          localEditor1.commit();
          this.SP = paramContext.getSharedPreferences("mat_app_version", 0);
          SharedPreferences.Editor localEditor2 = this.SP.edit();
          localEditor2.putString("version", Integer.toString(getAppVersion()));
          localEditor2.commit();
          this.install = "installed";
          int i = track("install", null, 0.0D, null);
          j = i;
          continue;
        }
      }
      finally
      {
      }
      int j = 2;
    }
  }

  public int trackPurchase(String paramString1, int paramInt, double paramDouble, String paramString2)
  {
    setPurchaseStatus(paramInt);
    return track(paramString1, null, paramDouble, paramString2);
  }

  public int trackUpdate()
  {
    this.SP = this.context.getSharedPreferences("mat_install", 0);
    SharedPreferences.Editor localEditor1 = this.SP.edit();
    localEditor1.putString("install", "installed");
    localEditor1.commit();
    this.SP = this.context.getSharedPreferences("mat_app_version", 0);
    SharedPreferences.Editor localEditor2 = this.SP.edit();
    localEditor2.putString("version", Integer.toString(getAppVersion()));
    localEditor2.commit();
    return track("update", null, 0.0D, null);
  }

  public class getLink
    implements Runnable
  {
    private String json = null;
    private String link = null;
    public int status = -2;

    public getLink(String paramString1, String arg3)
    {
      this.link = paramString1;
      Object localObject;
      this.json = localObject;
    }

    // ERROR //
    public void run()
    {
      // Byte code:
      //   0: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   3: ifeq +11 -> 14
      //   6: ldc 37
      //   8: ldc 39
      //   10: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   13: pop
      //   14: aload_0
      //   15: aload_0
      //   16: getfield 17	com/mobileapptracker/MobileAppTracker$getLink:this$0	Lcom/mobileapptracker/MobileAppTracker;
      //   19: aload_0
      //   20: getfield 22	com/mobileapptracker/MobileAppTracker$getLink:link	Ljava/lang/String;
      //   23: invokestatic 49	com/mobileapptracker/MobileAppTracker:access$2	(Lcom/mobileapptracker/MobileAppTracker;Ljava/lang/String;)Ljava/lang/String;
      //   26: putfield 22	com/mobileapptracker/MobileAppTracker$getLink:link	Ljava/lang/String;
      //   29: aload_0
      //   30: getfield 24	com/mobileapptracker/MobileAppTracker$getLink:json	Ljava/lang/String;
      //   33: ifnonnull +224 -> 257
      //   36: new 51	org/apache/http/client/methods/HttpGet
      //   39: dup
      //   40: aload_0
      //   41: getfield 22	com/mobileapptracker/MobileAppTracker$getLink:link	Ljava/lang/String;
      //   44: invokespecial 54	org/apache/http/client/methods/HttpGet:<init>	(Ljava/lang/String;)V
      //   47: astore_3
      //   48: aload_0
      //   49: getfield 17	com/mobileapptracker/MobileAppTracker$getLink:this$0	Lcom/mobileapptracker/MobileAppTracker;
      //   52: invokestatic 58	com/mobileapptracker/MobileAppTracker:access$3	(Lcom/mobileapptracker/MobileAppTracker;)Lorg/apache/http/client/HttpClient;
      //   55: aload_3
      //   56: invokeinterface 64 2 0
      //   61: astore 4
      //   63: aload_0
      //   64: aload 4
      //   66: invokeinterface 70 1 0
      //   71: invokeinterface 76 1 0
      //   76: putfield 26	com/mobileapptracker/MobileAppTracker$getLink:status	I
      //   79: aload_0
      //   80: getfield 26	com/mobileapptracker/MobileAppTracker$getLink:status	I
      //   83: sipush 200
      //   86: if_icmpne +259 -> 345
      //   89: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   92: ifeq +11 -> 103
      //   95: ldc 37
      //   97: ldc 78
      //   99: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   102: pop
      //   103: new 80	java/io/BufferedReader
      //   106: dup
      //   107: new 82	java/io/InputStreamReader
      //   110: dup
      //   111: aload 4
      //   113: invokeinterface 86 1 0
      //   118: invokeinterface 92 1 0
      //   123: ldc 94
      //   125: invokespecial 97	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
      //   128: sipush 8192
      //   131: invokespecial 100	java/io/BufferedReader:<init>	(Ljava/io/Reader;I)V
      //   134: astore 6
      //   136: aload 6
      //   138: invokevirtual 104	java/io/BufferedReader:readLine	()Ljava/lang/String;
      //   141: astore 7
      //   143: aload 6
      //   145: invokevirtual 107	java/io/BufferedReader:close	()V
      //   148: aload 7
      //   150: ifnull +98 -> 248
      //   153: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   156: ifeq +26 -> 182
      //   159: ldc 37
      //   161: new 109	java/lang/StringBuilder
      //   164: dup
      //   165: ldc 111
      //   167: invokespecial 112	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
      //   170: aload 7
      //   172: invokevirtual 116	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   175: invokevirtual 119	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   178: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   181: pop
      //   182: aload 7
      //   184: ldc 121
      //   186: invokevirtual 127	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
      //   189: iconst_1
      //   190: aaload
      //   191: astore 8
      //   193: aload 8
      //   195: ldc 129
      //   197: invokevirtual 133	java/lang/String:startsWith	(Ljava/lang/String;)Z
      //   200: ifeq +200 -> 400
      //   203: aload 8
      //   205: ldc 135
      //   207: invokevirtual 127	java/lang/String:split	(Ljava/lang/String;)[Ljava/lang/String;
      //   210: iconst_1
      //   211: aaload
      //   212: iconst_0
      //   213: iconst_2
      //   214: invokevirtual 139	java/lang/String:substring	(II)Ljava/lang/String;
      //   217: astore 10
      //   219: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   222: ifeq +26 -> 248
      //   225: ldc 37
      //   227: new 109	java/lang/StringBuilder
      //   230: dup
      //   231: ldc 141
      //   233: invokespecial 112	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
      //   236: aload 10
      //   238: invokevirtual 116	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
      //   241: invokevirtual 119	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   244: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   247: pop
      //   248: return
      //   249: astore_1
      //   250: aload_1
      //   251: invokevirtual 144	java/lang/Exception:printStackTrace	()V
      //   254: goto -225 -> 29
      //   257: new 146	org/json/JSONObject
      //   260: dup
      //   261: invokespecial 147	org/json/JSONObject:<init>	()V
      //   264: astore 14
      //   266: aload 14
      //   268: ldc 149
      //   270: new 151	org/json/JSONArray
      //   273: dup
      //   274: aload_0
      //   275: getfield 24	com/mobileapptracker/MobileAppTracker$getLink:json	Ljava/lang/String;
      //   278: invokespecial 152	org/json/JSONArray:<init>	(Ljava/lang/String;)V
      //   281: invokevirtual 156	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
      //   284: pop
      //   285: new 158	org/apache/http/entity/StringEntity
      //   288: dup
      //   289: aload 14
      //   291: invokevirtual 159	org/json/JSONObject:toString	()Ljava/lang/String;
      //   294: invokespecial 160	org/apache/http/entity/StringEntity:<init>	(Ljava/lang/String;)V
      //   297: astore 16
      //   299: aload 16
      //   301: ldc 162
      //   303: invokevirtual 165	org/apache/http/entity/StringEntity:setContentType	(Ljava/lang/String;)V
      //   306: new 167	org/apache/http/client/methods/HttpPost
      //   309: dup
      //   310: aload_0
      //   311: getfield 22	com/mobileapptracker/MobileAppTracker$getLink:link	Ljava/lang/String;
      //   314: invokespecial 168	org/apache/http/client/methods/HttpPost:<init>	(Ljava/lang/String;)V
      //   317: astore 17
      //   319: aload 17
      //   321: aload 16
      //   323: invokevirtual 172	org/apache/http/client/methods/HttpPost:setEntity	(Lorg/apache/http/HttpEntity;)V
      //   326: aload_0
      //   327: getfield 17	com/mobileapptracker/MobileAppTracker$getLink:this$0	Lcom/mobileapptracker/MobileAppTracker;
      //   330: invokestatic 58	com/mobileapptracker/MobileAppTracker:access$3	(Lcom/mobileapptracker/MobileAppTracker;)Lorg/apache/http/client/HttpClient;
      //   333: aload 17
      //   335: invokeinterface 64 2 0
      //   340: astore 4
      //   342: goto -279 -> 63
      //   345: aload_0
      //   346: getfield 17	com/mobileapptracker/MobileAppTracker$getLink:this$0	Lcom/mobileapptracker/MobileAppTracker;
      //   349: aload_0
      //   350: getfield 22	com/mobileapptracker/MobileAppTracker$getLink:link	Ljava/lang/String;
      //   353: aload_0
      //   354: getfield 24	com/mobileapptracker/MobileAppTracker$getLink:json	Ljava/lang/String;
      //   357: invokestatic 175	com/mobileapptracker/MobileAppTracker:access$4	(Lcom/mobileapptracker/MobileAppTracker;Ljava/lang/String;Ljava/lang/String;)V
      //   360: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   363: ifeq -115 -> 248
      //   366: ldc 37
      //   368: new 109	java/lang/StringBuilder
      //   371: dup
      //   372: ldc 177
      //   374: invokespecial 112	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
      //   377: aload_0
      //   378: getfield 26	com/mobileapptracker/MobileAppTracker$getLink:status	I
      //   381: invokevirtual 180	java/lang/StringBuilder:append	(I)Ljava/lang/StringBuilder;
      //   384: invokevirtual 119	java/lang/StringBuilder:toString	()Ljava/lang/String;
      //   387: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   390: pop
      //   391: return
      //   392: astore_2
      //   393: aload_0
      //   394: bipush 253
      //   396: putfield 26	com/mobileapptracker/MobileAppTracker$getLink:status	I
      //   399: return
      //   400: invokestatic 35	com/mobileapptracker/MobileAppTracker:access$1	()Z
      //   403: ifeq -155 -> 248
      //   406: ldc 37
      //   408: ldc 182
      //   410: invokestatic 45	android/util/Log:d	(Ljava/lang/String;Ljava/lang/String;)I
      //   413: pop
      //   414: return
      //
      // Exception table:
      //   from	to	target	type
      //   14	29	249	java/lang/Exception
      //   29	63	392	java/lang/Exception
      //   63	103	392	java/lang/Exception
      //   103	148	392	java/lang/Exception
      //   153	182	392	java/lang/Exception
      //   182	248	392	java/lang/Exception
      //   257	342	392	java/lang/Exception
      //   345	391	392	java/lang/Exception
      //   400	414	392	java/lang/Exception
    }
  }

  public class getUserAgent
    implements Runnable
  {
    private Context context;

    public getUserAgent(Context arg2)
    {
      Object localObject;
      this.context = localObject;
    }

    public void run()
    {
      try
      {
        WebView localWebView = new WebView(this.context);
        localWebView.setVisibility(8);
        WebSettings localWebSettings = localWebView.getSettings();
        localWebSettings.setAppCacheEnabled(false);
        localWebSettings.setCacheMode(2);
        localWebSettings.setJavaScriptEnabled(false);
        localWebSettings.setSavePassword(false);
        MobileAppTracker.this.setUserAgent(localWebView.getSettings().getUserAgentString());
        localWebView.destroy();
        return;
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.mobileapptracker.MobileAppTracker
 * JD-Core Version:    0.6.2
 */